﻿//-----------------------------------------------------------------------
// <copyright file="Implies.cs" company="tuliprules.org">
//     Copyright (c) 2011 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Implies class.</summary>
//-----------------------------------------------------------------------
namespace Tulip.Rules.Models.Rif.Prd
{
    using System;
    using System.ComponentModel;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents an implication, containing if and then roles.
    /// </summary>
    [Serializable]
    [DesignerCategory(@"code")]
    [XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2007/rif#")]
    [XmlRoot(Namespace = "http://www.w3.org/2007/rif#", IsNullable = false)]
    public class Implies : IRifPrdElement
    {
        /// <summary>
        /// The if field.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private If ifField;

        /// <summary>
        /// The then field.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ThenPart thenField;

        /// <summary>
        /// Gets or sets an antecedent role, containing FORMULA.
        /// </summary>
        [XmlElement("if", Order = 0)]
        public If If
        {
            get
            {
                return this.ifField;
            }

            set
            {
                this.ifField = value;
            }
        }

        /// <summary>
        /// Gets or sets a consequent role, containing ACTIONs.
        /// </summary>
        [XmlElement("then", Order = 1)]
        public ThenPart Then
        {
            get
            {
                return this.thenField;
            }

            set
            {
                this.thenField = value;
            }
        }
    }
}
